package com.work.demo.test;

import javafx.scene.layout.BorderImage;

public abstract class SpeedMeter {

    // 转速
    private double turnRate;

    public SpeedMeter(){

    }

    // 把计算车轮周长的方法定义成抽象方法
    public abstract double calGirth();


    public void setTurnRate(double turnRate){
        this.turnRate = turnRate;
    }
    //定义计算速度的通用算法
    public double getSpeed(){
        // 转速乘以周长
        return calGirth() * turnRate;
    }

}
